package com.ynet.middleground.user.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ynet.middleground.user.dto.InPortRoleDto;
import com.ynet.middleground.user.entity.EmployeeInformation;
import com.ynet.middleground.user.entity.UserBaseInformation;

/**
 * <p>
 * 用户中心公用 Mapper 接口
 * </p>
 *
 * @author DaiGaoLe
 * @since 2020-01-13
 */
public interface CommUtilsMapper extends BaseMapper<EmployeeInformation> {

    List<EmployeeInformation> getEmployeeInfo(@Param("page") Page page, @Param("map") Map<String, Object> map);

    List<InPortRoleDto> getRloeInfos(@Param("map") Map<String, Object> map);

    Map<String, String> getNames(@Param("id") Integer id);

    String isExist(@Param("map") Map<String, Integer> map);

    // 根据账号，查询符合条件的员工
    List<EmployeeInformation> getEmployeesByAccounts(@Param("userAccounts") String userAccounts);

    // 根据手机号，查询符合条件的员工
    List<UserBaseInformation> getEmployeesByPhone(@Param("phone") String phone);

    // 根据主键id,置空ur_employee_information表这条数据的organizationalId字段；
    Integer updateOrganizationalIdNull(Integer id);
}
